<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看分类详情
     */
    function detailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/returnsApply/getReturnsApplyObject.sjson",
            data: {returnsApplyId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("detailTable");
                /**设置展示信息**/
                var shopReturnsApply = data.shopReturnsApplyList;
                var showUploadImgList = data.showUploadImgList;
                var imgHtml="";
                for(var i=0;i<showUploadImgList.length;i++){
                    imgHtml+="<img id='uploadImg_detail_"+(i+1)+"' class='uploadImg' onMouseOver='showDetailBigImage("+(i+1)+",3,3,0)'  onMouseOut='showDetailRebackImage("+(i+1)+",1,1)' src='${uploadPath}/"+showUploadImgList[i]+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />";
                }
                $("#d_uploadImage").html(imgHtml);
                $("#d_loginName").html(shopReturnsApply[0].loginName);
                $("#d_returnsApplyNo").html(shopReturnsApply[0].returnsApplyNo);
                $("#d_ordersNo").html(shopReturnsApply[0].ordersNo);
                $("#d_productName").html(shopReturnsApply[0].productName);

                if(shopReturnsApply[0].disposeMode=="1"){
                    $("#d_disposeMode").html("返修");
                }else if(shopReturnsApply[0].disposeMode=="2"){
                    $("#d_disposeMode").html("换货");
                }else if(shopReturnsApply[0].disposeMode=="3"){
                    $("#d_disposeMode").html("退货");
                }

                $("#d_problemDescription").html(shopReturnsApply[0].problemDescription);
                $("#d_productAccessories").html(shopReturnsApply[0].productAccessories);
                $("#d_shippingAddress").html(shopReturnsApply[0].shippingAddress);
                $("#d_linkman").html(shopReturnsApply[0].linkman);
                $("#d_mobilePhone").html(shopReturnsApply[0].mobilePhone);

                if(shopReturnsApply[0].applyTime!=""&&shopReturnsApply[0].applyTime!=undefined){
                    $("#d_applyTime").html(new Date(shopReturnsApply[0].applyTime).Format("yyyy-MM-dd hh:mm:ss"));
                }
                $("#d_updateMember").html(shopReturnsApply[0].updateMember);
                if(shopReturnsApply[0].updateTime!=""&&shopReturnsApply[0].updateTime!=undefined){
                    $("#d_updateTime").html(new Date(shopReturnsApply[0].updateTime).Format("yyyy-MM-dd hh:mm:ss"));
                }

                $("#d_count").html(shopReturnsApply[0].count);

                if(shopReturnsApply[0].applyState=="1"){
                    $("#d_applyState").html("<font class='color_003'>待处理</font>");
                }else if(shopReturnsApply[0].applyState=="2"){
                    $("#d_applyState").html("<font class='color_001'>同意</font>");
                }else if(shopReturnsApply[0].applyState=="3"){
                    $("#d_applyState").html("<font class='color_002'>拒绝</font>");
                }

                if(shopReturnsApply[0].returnsState=="0"){
                    $("#d_returnsState").html("<font class='color_002'>退货申请待处理</font>");
                }else if(shopReturnsApply[0].returnsState=="1"){
                    $("#d_returnsState").html("<font class='color_004'>商家退货中【已同意退货】</font>");
                }else if(shopReturnsApply[0].returnsState=="2"){
                    $("#d_returnsState").html("<font class='color_005'>商家已收到用户退货</font>");
                }else if(shopReturnsApply[0].returnsState=="3"){
                    $("#d_returnsState").html("<font class='color_003'>商家线下退款，退款中</font>");
                }else if(shopReturnsApply[0].returnsState=="4"){
                    $("#d_returnsState").html("<font class='color_001'>线上、线下退款完成</font>");
                }

                $("#d_deliveryCorpName").html(shopReturnsApply[0].deliveryCorpName);
                $("#d_deliveryUrl").html(shopReturnsApply[0].deliveryUrl);
                $("#d_deliverySn").html(shopReturnsApply[0].deliverySn);
                $("#d_message").html(shopReturnsApply[0].message);
                $("#d_taxRate").html(shopReturnsApply[0].taxRate);
                $("#d_changeAmount").html(shopReturnsApply[0].changeAmount);
                $("#d_returnPrice").html(shopReturnsApply[0].returnPrice);
                $("#d_returnAmount").html(shopReturnsApply[0].returnAmount);
                $("#d_upRatioAmountPro").html(shopReturnsApply[0].upRatioAmountPro);
                $("#d_secRatioAmountPro").html(shopReturnsApply[0].secRatioAmountPro);
                $("#d_thiRatioAmountPro").html(shopReturnsApply[0].thiRatioAmountPro);
            }
        });
    }
</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">退货申请详情</h5>
			</div>
			<div class="modal-body">
				<table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">退货申请编号:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_returnsApplyNo"></span></td>
						<td class="toright_td" width="150px">会员名称:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_loginName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">订单号:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_ordersNo"></span></td>
						<td class="toright_td" width="150px">商品名称:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_productName"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">期望处理方式:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_disposeMode"></span></td>
						<td class="toright_td" width="150px">问题描述:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_problemDescription"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">申请退货图片:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_uploadImage"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">申请时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_applyTime"></span></td>
						<td class="toright_td" width="150px">退货数量:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_count"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">退货金额:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_returnAmount"></span></td>
						<td class="toright_td" width="150px">退货单价:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_returnPrice"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">商品规格描述:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_productAccessories"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">审核状态:</td>
						<td class="toleft_td" >&nbsp;&nbsp;<span id="d_applyState"></span></td>
						<td class="toright_td" width="150px">退货状态:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_returnsState"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">收货地址:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_shippingAddress"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">联系人:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_linkman"></span></td>
						<td class="toright_td" width="150px">手机号码:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_mobilePhone"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">物流公司查询网址:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_deliveryUrl"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">物流公司名称:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_deliveryCorpName"></span></td>
						<td class="toright_td" width="150px">物流运单号:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_deliverySn"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">换货物流信息:</td>
						<td class="toleft_td"  colspan="3">&nbsp;&nbsp;<span id="d_message"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">税率:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_taxRate"></span></td>
						<td class="toright_td" width="150px">金币抵扣:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_changeAmount"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">上一级返利:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_upRatioAmountPro"></span></td>
						<td class="toright_td" width="150px">上二级返利:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_secRatioAmountPro"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">上三级返利:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_thiRatioAmountPro"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">修改人:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_updateMember"></span></td>
						<td class="toright_td" width="150px">修改时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_updateTime"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>